<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>글목록</title>
</head>
<body>
<hr></hr>
<b>목록</b><p/>
<table border="1" width="650" cellpadding="2">
	<tr>
	<th>번호</th>
	<th>제목</th>
	<th>작성자</th>
	<th>작성일</th>
	<th>조회수</th>
	</tr>
	<c:forEach var="bvo" items="${requestScope.bvo.list }">
		<tr>
			<td>${bvo.no }</td>
			<td><a href="board.do?mode=content&no=${bvo.no }">${bvo.title }</a></td>
			<td>${bvo.memberVO.nickname }</td>
			<td>${bvo.w_data }</td>
			<td>${bvo.count }</td>
		</tr>
	</c:forEach>

</table>
<%-- <a href="board.do?mode=view&page=write&category=${param.category }">글쓰기</a> --%>
<!-- 로그인한 사용자만 글쓰기 가능 -->
<c:if test="${sessionScope.mvo!=null }">	
	<a href="board.do?mode=view&page=write&category=${param.category }">
	<img alt="글쓰기" src="${initParam.root }/img/write_btn.jpg" border="0"></a>
	</c:if>
	<br>
	<br>


<!-- 페이즹 -->	
<c:if test="${requestScope.bvo.pagingBean.previousPageGroup }">
<a href="board.do?mode=list&category=${param.category }&pageNo=${requestScope.bvo.pagingBean.startPageOfPageGroup-1 }">
<img src="${initParam.root }/img/left_arrow_btn.gif">
</a>
</c:if>	

	<c:forEach var="ppg" 
	begin="${requestScope.bvo.pagingBean.startPageOfPageGroup}"
	 end="${requestScope.bvo.pagingBean.endPageOfPageGroup}">
	 <c:choose>
	 <c:when test="${requestScope.bvo.pagingBean.nowPage!=ppg}">
	 <a href="board.do?mode=list&category=${param.category}&pageNo=${ppg}">${ppg }</a>
	 </c:when>
	 <c:otherwise>
	${ppg}
	</c:otherwise>
	</c:choose>
	</c:forEach>	 

<c:if test="${requestScope.bvo.pagingBean.nextPageGroup }">
												<!-- 다음 그룹의 시작페이지 -->
<a href="board.do?mode=list&category=${param.category}&pageNo=${requestScope.bvo.pagingBean.endPageOfPageGroup+1 }">
<img src="${initParam.root }/img/right_arrow_btn.gif">
</a>
</c:if>


</body>
</html>